Main Page | Class List | Class Members

BustaNetClient Class Reference

Client network interface to Busta'Sandwich. More...

#include <BustaNetClient.h>

List of all members.

Public Member Functions

 BustaNetClient ()
 Constructor.
 ~BustaNetClient ()
 Destructor.
char * init ()
 Initializes the client and prepares it for connection.
connect_respconnect (char *IP, Uint16 serverPort)
 Connects to a server using a given port.
void disconnect ()
 Disconnects from the server.
void processNet ()
 Handles all incoming network data.
void sendGameOver ()
 Notifies the server that the player has lost the game.
void sendOpponentViewReq (int opponentID)
 Tells the server which opponent the player wishes to view.


Detailed Description

Client network interface to Busta'Sandwich.

Busta'Sandwich Client for networked multiplayer games.


Constructor & Destructor Documentation

BustaNetClient::BustaNetClient  ) 
 

Constructor.

Initializes variables

BustaNetClient::~BustaNetClient  ) 
 

Destructor.

Close any open connections and shutdown SDLNet


Member Function Documentation

connect_resp * BustaNetClient::connect char *  IP,
Uint16  serverPort
 

Connects to a server using a given port.

The client initializes a TCP connect with the server on the specified port. On successful connection, an attempt to join the game is made.

Parameters:
IP The IP address of the server to connect to.
serverPort The port of the server to connect to.
Returns:
Returns a pointer to a connect_resp struct outlining the outcome of the connection attempt.

void BustaNetClient::disconnect  ) 
 

Disconnects from the server.

The connection between the server and client is disconnected. Subsequent connections may be made using the client

char * BustaNetClient::init  ) 
 

Initializes the client and prepares it for connection.

Initializes SDLNet. Relays any error message back.

Returns:
Returns a cstring containing an error message if SDLNet cannot be initialized. On no error, null is returned.

void BustaNetClient::processNet  ) 
 

Handles all incoming network data.

Processes all data currently queued on the TCP socket. The data is partitioned out into three message containers. Each of these three message containers is accessible through an accompanying method.

See also:
getMPGS()

getPriorityQ()

getSandwichQ()

void BustaNetClient::sendGameOver  ) 
 

Notifies the server that the player has lost the game.

A message is sent to the server to notify it that the player has lost in the current multiplayer game.

void BustaNetClient::sendOpponentViewReq int  opponentID  ) 
 

Tells the server which opponent the player wishes to view.

A message is sent to the server to tell it which opponent the player wishes to have a detailed view of. The detailed view contains information to display the entire screen of the opponent rather than limited brief data.

Parameters:
opponentID The identification of the opponent whom the player wishes to view


Generated on Tue Jul 19 21:01:00 2005 for BustaSandwich by  doxygen 1.4.2-20050421